package com.yaha.controler.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.yaha.controler.db.interfaces.DeviceHistoryList;

public class MySQLiteHelper extends SQLiteOpenHelper {
	static final String TAG = MySQLiteHelper.class.getSimpleName();
	static final String DB_NAME = "yaha_controler.db";
	static final int DB_VERSION = 1;

	public MySQLiteHelper(Context context) {
		super(context, DB_NAME, null, DB_VERSION);

	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(DeviceHistoryList.DB_CREAT);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS " + DeviceHistoryList.TABLE_NAME + ";");
		onCreate(db);
	}

}
